package com.wisewin.circle.service;

import com.wisewin.circle.config.dto.ResultDTO;
import com.wisewin.circle.config.dto.ResultDTOBuilder;
import com.wisewin.circle.dao.TypeDAO;
import com.wisewin.circle.entity.db.TypeDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional
public class TypeService {

    @Autowired
    private TypeDAO typeDAO;

    // 查询类型
    public ResultDTO queryTypeList(Integer typeHandle){
        if(typeHandle == null){
            return ResultDTOBuilder.failure("1", "参数有误", null);
        }
        List<TypeDO> lstType = typeDAO.queryTypeList(typeHandle);
        return ResultDTOBuilder.success(lstType);
    }
}
